<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%> 
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<sx:head/>
<title>Insert title here</title>
<script type="text/javascript">
djConfig = {
    scopeMap: [
        ["dojo", "coolio"],
        ["dijit", "cooliow"],
        ["dojox", "cooliox"],
    ],
    modulePaths: {
        "coolio.actions": "../coolio/actions"
    },
    bindEncoding: "UTF-8",
    parseOnLoad : true,
    _hasResource: [],
    searchIds: []
};
</script>
<script type="text/javascript" src="<%=basePath%>javascript/dojo/dojo/dojo.js"></script>
<script type="text/javascript" src="<%=basePath%>javascript/get_tag.js"></script>
<link rel="stylesheet" type="text/css" href="../stylesheet/layout.css" />
</head>
<body>
	<jsp:include page="../common/header.jsp"></jsp:include>
	<div id="main">
	<s:property value="notice"/>
	<form id="editForm" action='<s:url action="edit"/>' method="post" onSubmit="window.onbeforeunload = null;">
		<table>
			<tr>
				<td>name</td>
				<td><input type="text" name="name"
					value="<s:property value="user.name"/>" /></td>
			</tr>
			<tr>
				<td>email</td>
				<td><s:property value="user.email" /></td>
			</tr>
			<tr>
				<td>age</td>
				<td><input type="text" name="age"
					value="<s:property value="user.age"/>" /></td>
			</tr>
			<tr>
				<td>university</td>
				<td><input type="text" name="university"
					value="<s:property value="user.university"/>" /></td>
			</tr>
			<tr>
				<td>school</td>
				<td><input type="text" name="school"
					value="<s:property value="user.school"/>" /></td>
			</tr>
			<tr>
				<td>gender</td>
				<td><select name="gender">
						<option value="male" selected>male</option>
						<option value="female">female</option>
				</select></td>
			</tr>
			<tr>
				<td>description</td>
				<td><textarea name="description"><s:property value="user.description" /></textarea></td>
			</tr>
			<tr>
				<td>expert</td>
				<td><input id="expertCheckbox" type="checkbox" name="expert" value="true"/>Willing to be an Expert!</td>
			</tr>
			<tr>
				<td>expert field</td>
				<td>
				<s:iterator value="user.experts">
				<span id="expertTag<s:property value='id'/>"><s:property value="name"/>&nbsp;<input type='hidden' name='expertIds' value='<s:property value="id"/>'/><img src='../image/cancel.png' onclick='this.parentNode.parentNode.removeChild(this.parentNode);'/></span>
				</s:iterator>
				<span id="expertTags"></span>
				<br/><input type="text" name="tag" autocomplete="off" onKeyUp="get_tags('<%=basePath%>',this,'expert');"/>&nbsp;<img src="../image/add.png" onclick="addTag('<%=basePath%>','expert');"/>
				</td>
			</tr>
			<tr>
				<td>interest field</td>
				<td>
				<s:iterator value="user.interests">
				<span id="interestTag<s:property value='id'/>"><s:property value="name"/>&nbsp;<input type='hidden' name='interestIds' value='<s:property value="id"/>'/><img src='../image/cancel.png' onclick='this.parentNode.parentNode.removeChild(this.parentNode);'/></span>
				</s:iterator>
				<span id="interestTags"></span>
				<br/><input type="text" name="tag" autocomplete="off" onKeyUp="get_tags('<%=basePath%>',this,'interest');"/>&nbsp;<img src="../image/add.png" onclick="addTag('<%=basePath%>','interest');"/>
				</td>
			</tr>
			<tr>
				<td colspan="2"><input type="submit" value="edit" /></td>
			</tr>
		</table>
	</form>
	</div>
	
	<div id="hintsDiv" style="display:none;position:absolute;">
	</div>
</body>
<script type="text/javascript">
	var expert='<s:property value="user.expert"/>';
	if(expert=='true'){
		var checkbox=document.getElementById('expertCheckbox');
		checkbox.checked='checked';
	}
</script>
</html>